Integrand size = 24, antiderivative size = 114 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {x}{4 a^2}+\frac {i a}{12 d (a+i a \tan (c+d x))^3}+\frac {i}{8 d (a+i a \tan (c+d x))^2}-\frac {i}{16 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {3 i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )} \]
1/4*x/a^2+1/12*I*a/d/(a+I*a*tan(d*x+c))^3+1/8*I/d/(a+I*a*tan(d*x+c))^2-1/1 6*I/d/(a^2-I*a^2*tan(d*x+c))+3/16*I/d/(a^2+I*a^2*tan(d*x+c))
Time = 0.29 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.85 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=-\frac {4 i+\tan (c+d x)+6 i \tan ^2(c+d x)-3 \tan ^3(c+d x)-3 \arctan (\tan (c+d x)) (-i+\tan (c+d x))^3 (i+\tan (c+d x))}{12 a^2 d (-i+\tan (c+d x))^3 (i+\tan (c+d x))} \]
-1/12*(4*I + Tan[c + d*x] + (6*I)*Tan[c + d*x]^2 - 3*Tan[c + d*x]^3 - 3*Ar cTan[Tan[c + d*x]]*(-I + Tan[c + d*x])^3*(I + Tan[c + d*x]))/(a^2*d*(-I + Tan[c + d*x])^3*(I + Tan[c + d*x]))
Time = 0.30 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 3968, 54, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (c+d x)^2 (a+i a \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 3968 |
\(\displaystyle -\frac {i a^3 \int \frac {1}{(a-i a \tan (c+d x))^2 (i \tan (c+d x) a+a)^4}d(i a \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 54 |
\(\displaystyle -\frac {i a^3 \int \left (\frac {1}{16 a^4 (a-i a \tan (c+d x))^2}+\frac {3}{16 a^4 (i \tan (c+d x) a+a)^2}+\frac {1}{4 a^3 (i \tan (c+d x) a+a)^3}+\frac {1}{4 a^2 (i \tan (c+d x) a+a)^4}+\frac {1}{4 a^4 \left (\tan ^2(c+d x) a^2+a^2\right )}\right )d(i a \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {i a^3 \left (\frac {i \arctan (\tan (c+d x))}{4 a^5}+\frac {1}{16 a^4 (a-i a \tan (c+d x))}-\frac {3}{16 a^4 (a+i a \tan (c+d x))}-\frac {1}{8 a^3 (a+i a \tan (c+d x))^2}-\frac {1}{12 a^2 (a+i a \tan (c+d x))^3}\right )}{d}\) |
((-I)*a^3*(((I/4)*ArcTan[Tan[c + d*x]])/a^5 + 1/(16*a^4*(a - I*a*Tan[c + d *x])) - 1/(12*a^2*(a + I*a*Tan[c + d*x])^3) - 1/(8*a^3*(a + I*a*Tan[c + d* x])^2) - 3/(16*a^4*(a + I*a*Tan[c + d*x]))))/d
3.2.20.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[E xpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && ILtQ[m, 0] && IntegerQ[n] && !(IGtQ[n, 0] && LtQ[m + n + 2, 0])
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[1/(a^(m - 2)*b*f) Subst[Int[(a - x)^(m/2 - 1)*(a + x )^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]
Time = 1.75 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.69
method | result | size |
risch | \(\frac {x}{4 a^{2}}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{16 a^{2} d}+\frac {i {\mathrm e}^{-6 i \left (d x +c \right )}}{96 a^{2} d}+\frac {5 i \cos \left (2 d x +2 c \right )}{32 a^{2} d}+\frac {7 \sin \left (2 d x +2 c \right )}{32 a^{2} d}\) | \(79\) |
derivativedivides | \(\frac {\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{8}+\frac {1}{16 \tan \left (d x +c \right )+16 i}-\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{8}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}}{d \,a^{2}}\) | \(88\) |
default | \(\frac {\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{8}+\frac {1}{16 \tan \left (d x +c \right )+16 i}-\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{8}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}}{d \,a^{2}}\) | \(88\) |
1/4*x/a^2+1/16*I/a^2/d*exp(-4*I*(d*x+c))+1/96*I/a^2/d*exp(-6*I*(d*x+c))+5/ 32*I/a^2/d*cos(2*d*x+2*c)+7/32/a^2/d*sin(2*d*x+2*c)
Time = 0.24 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.57 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {{\left (24 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 18 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{96 \, a^{2} d} \]
1/96*(24*d*x*e^(6*I*d*x + 6*I*c) - 3*I*e^(8*I*d*x + 8*I*c) + 18*I*e^(4*I*d *x + 4*I*c) + 6*I*e^(2*I*d*x + 2*I*c) + I)*e^(-6*I*d*x - 6*I*c)/(a^2*d)
Time = 0.23 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.66 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\begin {cases} \frac {\left (- 24576 i a^{6} d^{3} e^{14 i c} e^{2 i d x} + 147456 i a^{6} d^{3} e^{10 i c} e^{- 2 i d x} + 49152 i a^{6} d^{3} e^{8 i c} e^{- 4 i d x} + 8192 i a^{6} d^{3} e^{6 i c} e^{- 6 i d x}\right ) e^{- 12 i c}}{786432 a^{8} d^{4}} & \text {for}\: a^{8} d^{4} e^{12 i c} \neq 0 \\x \left (\frac {\left (e^{8 i c} + 4 e^{6 i c} + 6 e^{4 i c} + 4 e^{2 i c} + 1\right ) e^{- 6 i c}}{16 a^{2}} - \frac {1}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x}{4 a^{2}} \]
Piecewise(((-24576*I*a**6*d**3*exp(14*I*c)*exp(2*I*d*x) + 147456*I*a**6*d* *3*exp(10*I*c)*exp(-2*I*d*x) + 49152*I*a**6*d**3*exp(8*I*c)*exp(-4*I*d*x) + 8192*I*a**6*d**3*exp(6*I*c)*exp(-6*I*d*x))*exp(-12*I*c)/(786432*a**8*d** 4), Ne(a**8*d**4*exp(12*I*c), 0)), (x*((exp(8*I*c) + 4*exp(6*I*c) + 6*exp( 4*I*c) + 4*exp(2*I*c) + 1)*exp(-6*I*c)/(16*a**2) - 1/(4*a**2)), True)) + x /(4*a**2)
Exception generated. \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \]
Time = 0.53 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.90 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=-\frac {-\frac {6 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} + \frac {6 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} + \frac {3 \, {\left (2 i \, \tan \left (d x + c\right ) - 3\right )}}{a^{2} {\left (\tan \left (d x + c\right ) + i\right )}} + \frac {-11 i \, \tan \left (d x + c\right )^{3} - 42 \, \tan \left (d x + c\right )^{2} + 57 i \, \tan \left (d x + c\right ) + 30}{a^{2} {\left (\tan \left (d x + c\right ) - i\right )}^{3}}}{48 \, d} \]
-1/48*(-6*I*log(tan(d*x + c) + I)/a^2 + 6*I*log(tan(d*x + c) - I)/a^2 + 3* (2*I*tan(d*x + c) - 3)/(a^2*(tan(d*x + c) + I)) + (-11*I*tan(d*x + c)^3 - 42*tan(d*x + c)^2 + 57*I*tan(d*x + c) + 30)/(a^2*(tan(d*x + c) - I)^3))/d
Time = 3.94 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.62 \[ \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {x}{4\,a^2}-\frac {\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}}{4}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{12}+\frac {1}{3}}{a^2\,d\,{\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^3\,\left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )} \]